Static namespace for link module
Typedefs Summary: | |
std::map<std::string, std::string> | TOC Type of the TableOfContents [Source] |
Structs Summary: | |
Link Encapsulation of a link fragment. [Source] |
Functions Summary: | |
std::ostream& | operator<<(std::ostream& o, const Link::Map::value_type& linepair) Debugging output operator for members of the Link Map [Source] |
void | parse_args(int argc, char** argv) Parses the command line arguments given to main() [Source] |
void | write(std::ostream& out, int col, char* buf, int len, int buflen) Writes some text to the output. [Source] |
void | write_lineno(std::ostream& out, int line) Writes the line number to the output [Source] |
std::string | decode(const std::string& str) Undoes the %FF encoding [Source] |
void | write_indent(std::ostream& out, char* buf, int& col, int buflen) Writes whatever indent there is in the buf to the output using the special span. [Source] |
bool | is_duplicate(Link* link, int len) Returns true if the link is a duplicate. [Source] |
void | read_links() Reads the links file into the 'links' map. [Source] |
void | dump_links() Debugging method to dump all links to cout. [Source] |
void | read_tocs() Reads in the TOC files. [Source] |
void | link_file() Reads the input file, inserts links, and writes the result to the output. [Source] |
Module variables Summary: | |
const char* | input_filename Filename of the input source file [Source] |
const char* | output_filename Filename of the output HTML file [Source] |
const char* | links_filename Filename of the links file [Source] |
const char* | links_scope Scope to prepend to links before to find in TOC [Source] |
std::vector<std::string> | toc_filenames A list of TOC's to load [Source] |
bool | links_append True if should append to output file. [Source] |
Link::Map | links A map of links to insert into the output [Source] |
TOC | toc The TOC used for looking up hrefs [Source] |
Function Details: |
Writes some text to the output. It replaces chars that might be confused by HTML, such as < and >. All spaces are replaced with non-breaking spaces, and tabs are expanded to 8-col tabstops (hence the col argument)
Writes whatever indent there is in the buf to the output using the special span. 'col' is modified to the first non-indent character.
Reads in the TOC files. The filenames are taken from the toc_filenames array and store in the 'toc' map.
Reads the input file, inserts links, and writes the result to the output. It uses the 'links' line map to iterate through the file sequentially.
Module variable Details: |
True if should append to output file. Note that this only works if the process previously using the file has flushed things to disk!